import 'package:appflutterhomeschool/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///   作者：NinetailFox
///   时间：2020/3/30 10:26
///   邮箱：1037438704@qq.com
///   说明：Tab
class BottomNavigationBarWidget extends StatelessWidget {
  final int currentIndex;
  final ValueChanged<int> changedOnTap;

  BottomNavigationBarWidget({this.currentIndex, this.changedOnTap});

  @override
  Widget build(BuildContext context) {
    return BottomNavigationBar(
      currentIndex: currentIndex,
      onTap: changedOnTap,
      type: BottomNavigationBarType.fixed,
      fixedColor: Colors.black,
      items: [
        BottomNavigationBarItem(
          icon: Image.asset(
            Utils.getImgPath("nav_tongzhi_false"),
            fit: BoxFit.cover,
            width: ScreenUtil().setSp(68),
            height: ScreenUtil().setSp(68),
          ),
          activeIcon: Image.asset(
            Utils.getImgPath("nav_tongzhi_true"),
            fit: BoxFit.cover,
            width: ScreenUtil().setSp(70),
            height: ScreenUtil().setSp(70),
          ),
          title: Text("通知"),
        ),
        BottomNavigationBarItem(
          icon: Image.asset(
            Utils.getImgPath("nav_xinjian_false"),
            fit: BoxFit.cover,
            width: ScreenUtil().setSp(68),
            height: ScreenUtil().setSp(68),
          ),
          activeIcon: Image.asset(
            Utils.getImgPath("nav_xinjian_true"),
            fit: BoxFit.cover,
            width: ScreenUtil().setSp(70),
            height: ScreenUtil().setSp(70),
          ),
          title: Text("信件"),
        ),
        BottomNavigationBarItem(
          icon: Image.asset(
            Utils.getImgPath("nav_xueqing_false"),
            fit: BoxFit.cover,
            width: ScreenUtil().setSp(68),
            height: ScreenUtil().setSp(68),
          ),
          activeIcon: Image.asset(
            Utils.getImgPath("nav_xueqing_true"),
            fit: BoxFit.cover,
            width: ScreenUtil().setSp(70),
            height: ScreenUtil().setSp(70),
          ),
          title: Text("学情"),
        ),
        BottomNavigationBarItem(
          icon: Image.asset(
            Utils.getImgPath("nav_wode_true"),
            fit: BoxFit.cover,
            width: ScreenUtil().setSp(68),
            height: ScreenUtil().setSp(68),
          ),
          activeIcon: Image.asset(
            Utils.getImgPath("nav_wode_false"),
            fit: BoxFit.cover,
            width: ScreenUtil().setSp(70),
            height: ScreenUtil().setSp(70),
          ),
          title: Text("我的"),
        ),
      ],
    );
  }
}
